Skip to content

Fix fresh-agent resume pane repair#354

Open
danshapiro wants to merge 16 commits into
mainfrom
codex/fresh-agent-resume-pane-repair-main-20260518
Open

Fix fresh-agent resume pane repair#354
danshapiro wants to merge 16 commits into
mainfrom
codex/fresh-agent-resume-pane-repair-main-20260518

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • Ports the resume pane repair from dev commit 6e03da80 onto the fresh-agent dependency stack.
  • Repairs an existing pane when the resolved fresh-agent runtime provider differs from the stored pane content.
  • Preserves canonical sessionRef when creating resumed tabs and terminal panes from buildResumeContent.

Dependencies

Tests

  • npm run test:vitest -- test/unit/client/store/tabsSlice.test.ts --run
  • npm run typecheck
  • npm run build

Notes

Dan Shapiro added 13 commits May 18, 2026 01:43
Ported the fresh-agent portions of bf59a03.

Excluded Codex durability hunks that require the later durability subset.
Ported from ce6bb53.

Excluded adjacent Codex durability dependencies from the stale dev stack.
Partially ported e02e695.

The PR #350 unit tests already cover fresh-agent pane migration expectations; this keeps them and applies the missing canonical resume-id e2e assertion.
Ported the canonical fresh-agent recovery portions of 9290e5f.

Excluded sidebar live-terminal and Codex durability adjacent hunks for the later durability subset.
Port the fresh-agent canonical recovery portion of bf4f948.

Exclude OpenCode lab-note churn and unrelated tabs range behavior from the stale dev-stack carrier.
Port the fresh-agent production runtime and replay-cache cleanup portions of 0dea351.

Exclude Codex durability cleanup, sidecar deletion, launch-retry tests, and plan/doc residue from the stale carrier.
Keep the canonical UUID fixture updates from ca8c188, but do not carry the OpenCode ownership expectation from the stale carrier.

Also fix the fresh-agent production wiring test syntax introduced during the manual 0dea351 port.
Remote legacy agent-chat snapshots now reopen as fresh-agent tabs while preserving the Claude mode from the source record.
Carry the canonical recovery prerequisite from e333d1a so copied legacy agent-chat panes can recover from UUID resumeSessionId values.

This is limited to Claude canonical identity promotion and does not include Codex durability or OpenCode behavior.
Align shared session-contract coverage with canonical agent-chat resumeSessionId promotion carried for the fresh-agent recovery subset.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e191d2e7af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/store/tabsSlice.ts
Comment on lines +615 to +620
(content.kind === 'agent-chat' || content.kind === 'fresh-agent')
&& content.resumeSessionId === sessionId
&& (
content.kind === 'agent-chat'
? resolvedProvider === 'claude'
: content.provider === resolvedProvider
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Match fresh-agent repair by session identity, not provider

This implicit match gate prevents repairing the exact provider-mismatch case when a pane only has resumeSessionId (no canonical sessionRef, which is common in legacy/restored data). findTabIdForSession can still find the tab via sessionType, but repairExistingTabLayout then rejects the leaf because content.provider is wrong, so the pane is never rewritten to desiredResumeContent and users keep a broken pane/duplicate reopen path.

Useful? React with 👍 / 👎.

provider,
resumeSessionId,
...(sessionRef ? { sessionRef } : {}),
serverInstanceId: record.serverInstanceId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear remote server instance when sanitizing fresh-agent panes

For reopened history from another server, this always stamps the remote serverInstanceId into the new local pane. Session matching later filters out candidates whose server instance differs from local, so even panes with a valid sessionRef stop being discoverable as existing session tabs and repeated opens create duplicates. The adjacent agent-chat migration path already avoids this by only carrying serverInstanceId on same-server restores.

Useful? React with 👍 / 👎.

Dan Shapiro added 3 commits May 18, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant